package xian.woniuxy.be.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xian.woniuxy.be.dao.OrderdetailMapper;
import xian.woniuxy.be.dao.custom.CustomOrderdetailMapper;
import xian.woniuxy.be.entity.Orderdetail;
import xian.woniuxy.be.service.IOrderdetailService;

import java.util.List;

/**
 * @author Gong
 * @time 2022/01/09 01:00:19
 */
@Service
@Transactional
public class OrderdetailServiceImpl implements IOrderdetailService {

    @Autowired
    private CustomOrderdetailMapper orderdetailMapper;

    @Override
    public List<Orderdetail> findOne(int orderId) {
        List<Orderdetail> list = orderdetailMapper.selectOne(orderId);
        return list;
    }

    @Override
    public void delete(int orderdetailId) {
        orderdetailMapper.deleteByPrimaryKey(orderdetailId);
    }

    @Override
    public void update(Orderdetail orderdetail) {
        orderdetailMapper.updateByPrimaryKey(orderdetail);
    }
}
